import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** CRM 客户品牌信息 */
export interface Brand {
          id: number; // 品牌id
          customerId: number; // 所属客户id
          brandName?: string; // 品牌名称
          brandNo?: string; // 品牌编码(K3一致)
          erpFltemId: number; // K3品牌表主键id
          status?: number; // 状态
  }

// CRM 客户品牌 API
export const BrandApi = {
  // 查询CRM 客户品牌分页
  getBrandPage: async (params: any) => {
    return await request.get({ url: `/crm/brand/page`, params })
  },

  // 查询CRM 客户品牌详情
  getBrand: async (id: number) => {
    return await request.get({ url: `/crm/brand/get?id=` + id })
  },

  // 新增CRM 客户品牌
  createBrand: async (data: Brand) => {
    return await request.post({ url: `/crm/brand/create`, data })
  },

  // 修改CRM 客户品牌
  updateBrand: async (data: Brand) => {
    return await request.put({ url: `/crm/brand/update`, data })
  },

  // 删除CRM 客户品牌
  deleteBrand: async (id: number) => {
    return await request.delete({ url: `/crm/brand/delete?id=` + id })
  },

  /** 批量删除CRM 客户品牌 */
  deleteBrandList: async (ids: number[]) => {
    return await request.delete({ url: `/crm/brand/delete-list?ids=${ids.join(',')}` })
  },

  // 导出CRM 客户品牌 Excel
  exportBrand: async (params) => {
    return await request.download({ url: `/crm/brand/export-excel`, params })
  },

  // 品牌列表
  getBrandSimpleList:async () =>{
    return await request.get({ url: `/crm/brand/simple-list` })
  }
}

// 客户列表
// export const getBrandSimpleList = async () => {
//   return await request.get({ url: `/crm/brand/simple-list` })
// }
